<?php
/**
 * Created by PhpStorm.
 * User: yandian
 * Date: 2017/5/12
 * Time: 16:16
 */

namespace app\weixin\controller;


use app\common\controller\LiteBase;
use app\common\util\weixin\OAuth;

class Test extends LiteBase
{
    public function index()
    {
         //$sql = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='..'&redirect_uri=http%3A%2F%2Fwww.haosesalad.com%2Fauth%2Fwclogin&response_type=code&scope=snsapi_userinfo,snsapi_health_realtime,snsapi_health_history&state=sportVersion3&connect_redirect=1#wechat_redirect';
        //https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9c55bf11ee238405&redirect_uri=http%3A%2F%2Fwww.haosesalad.com%2Fauth%2Fwclogin&response_type=code&scope=snsapi_userinfo,snsapi_health_realtime,snsapi_health_history&state=sportVersion3&connect_redirect=1#wechat_redirect
        $userInfo = OAuth::getUserInfo2();
        var_dump($userInfo);
    }
}